<template>
  <div class="ArticleContent_class">
    <div><b>{{ $store.state.ArticleTitle }}</b></div>
    <div
        style="max-width: 100%;overflow: auto;"
        v-html="ArticleContentText"
    >
    </div>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  name: 'ArticleContent',
  data() {
    return {
      ArticleContentText: ""
    }
  },
  mounted() {
    var that = this
    axios.get('api/ArticleContent',
        {
          params: {
            id: that.$store.state.ArticleId
          }
        })
        .then(function (res) {
          console.log(res.data)
          that.ArticleContentText = res.data.articletext.replace(/\n/g, '<br>')
        })
        .catch(function (error) {
          console.log(error)
        })
  }
}
</script>

<style>
.ArticleContent_class {
  width: 90vw;
  height: auto;
  margin: 2vh auto;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 5px;
  background-color: #fff;
  word-wrap: break-word;
  word-break: normal;
}
</style>
